package com.champ.demo.entity;


import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.Size;

@Data
@Entity(name = "suser")
@NoArgsConstructor
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@EqualsAndHashCode(callSuper = true)
public class User extends BaseIdEntity {
    @Size(min = 1, max = 50)
    @Column(name = "name", nullable = false, length = 50, unique = true)
    private String name;

    public User(@Size(min = 1, max = 50) String name) {
        this.name = name;
    }
}
